package ru.autofan.logic;

import java.util.UUID;

import ru.autofan.domain.UserRegistrationRequest;
import ru.autofan.form.RegistrationForm;


public class RegistrationRequestService extends BasicService {

	/**
	 * 
	 * @param form
	 * @return UUID
	 */
	public String create(RegistrationForm form) {
		UserRegistrationRequest request = new UserRegistrationRequest();
		request.setEmail(form.getEmail());
		request.setFirstName(form.getFirstName());
		request.setLastName(form.getLastName());
		request.setSecondName(form.getSecondName());
		request.setUPassword(form.getPassword());
		String uuid = UUID.randomUUID().toString();
		request.setUuid(uuid);
		getDomainFactory().save(request);
		return uuid;
	}

}
